#include "Employee.h"
#include "Exceptions.h"

using namespace DataStructuresWet1;

Employee::Employee(int id, int employerID, Rational baseSalary) : EmployerID(employerID), BaseSalary(baseSalary), id(id)
{
	if (!IsLegalEmployeeID(id) ||
		IsLegalEmployeeSalary(baseSalary))
	{
		throw InvalidInputException();
	}
}
Employee::Employee(const Employee& e) : EmployerID (e.EmployerID), BaseSalary(e.BaseSalary), id(e.id)
{
}
Employee::~Employee()
{
}
int Employee::GetID() const
{
	return id;
}
const Rational Employee::GetBaseSalary() const
{
	return BaseSalary;
}
int Employee::GetEmployerID() const
{
	return EmployerID;
}
void Employee::SetID(int id)
{
	this->id = id;
}
void Employee::SetBaseSalary(Rational baseSalary)
{
	this->BaseSalary = baseSalary;
}
void Employee::SetEmployerID(int employerID)
{
	this->EmployerID = employerID;
}

bool Employee::IsLegalEmployeeID(int id)
{
	return id >= 0;
}
bool Employee::IsLegalEmployeeSalary(Rational salary)
{
	return salary  >0;
}